import store from "@/store";
import dayjs from "dayjs";
export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};
export const formBase = [
  {
    label: "上架日期",
    type: "daterange",
    field: "shelfTime",
    prop: "shelfTime",
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    },
  },
  {
    label: "入库员工",
    type: "select",
    required: true,
    field: "shelfEmployee",
    optionsKey: "userName",
    optionsValue: "userId",
    options: [],
  },
];

export const tableBase = [
  {
    label: "入库员工",
    prop: "shelfEmployee",
    width: "200",
  },
  {
    label: "数量",
    prop: "quantity",
    width: "200",
  },
  {
    label: "重量",
    prop: "actualWeight",
    width: "200",
  },
];

export const tableBase2 = [
  {
    label: "员工",
    prop: "shelfEmployee",
    width: "200",
  },
  {
    label: "单号",
    prop: "courierNumber",
    width: "200",
  },
  {
    label: "快递公司",
    prop: "companyName",
    width: "200",
  },
  {
    label: "库位",
    prop: "locationName",
    width: "200",
  },
  {
    label: "三边总长",
    prop: "totalLength",
    width: "200",
  },
  {
    label: "会员昵称",
    prop: "userName",
    width: "200",
  },
  {
    label: "实重",
    prop: "actualWeight",
    width: "200",
  },
  {
    label: "上架时间",
    prop: "shelfTime",
    width: "200",
  },
];
